<template>
	<view class="body">
		<myHead :title="title" />
		<userShow v-if="!isUser" :isUser="isUser"/>
		<admin v-if="isUser" :menu="menu" />
		<myFooter :isSelected.sync="selected" />
	</view>
	
</template>

<script>
	import {judgeGroupOrCrew,getTaskList,getLeaderTasksDetail,detail} from '@/api/api_message.js'
	import userShow from './userShow.vue'
	import admin from './admin.vue'
	import myHeader from '../components/index_header.vue'
	import myFooter from '../components/index_footer.vue'
	export default {
		data() {
			return {
				title: "我的任务",
				value: "",
				isUser:true,//true 组长 false组员
				selected: 'message',
				menu:[],
				}
			}, components: {
					myHead: myHeader,
					myFooter: myFooter,
					userShow,admin
				},
				
				async  mounted(){
					judgeGroupOrCrew().then(res=>{
						this.isUser = res;
						// this.isUser = false
					if(this.isUser){//组长
						let data = uni.getStorageSync("menuMap")	
						this.menu = data.filter(e=>  e.departId === 1 ||e.departId===5)
					}else{//组员角色
						
					}
					})
				},
				methods: {
				},onBackPress(e){
				 	  uni.showModal({  
				 		title: '提示',  
				 		content: '是否退出uni-app？',  
				 		success: function(res) {  
				 			if (res.confirm) {  
				 				// 退出当前应用，改方法只在App中生效  
				 				plus.runtime.quit();  
				 			} else if (res.cancel) {  
				 				console.log('用户点击取消');  
				 			}  
				 		}  
				 	  });  
				 	  return true 
				}
		
		}
</script>
<style lang="scss" scoped>
	.body {
		
	}
</style>
